package com.heima.behavior.controller;

import com.heima.behavior.service.CommentReplyService;
import com.heima.model.behavior.dtos.*;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/comment_repay")
public class CommentReplyController {
    @Autowired
    CommentReplyService commentReplyService;
    /**
     * 保存评论
     */
    @PostMapping("/save")
    public ResponseResult saveComment(@RequestBody CommentReplyDto dto) {
        return commentReplyService.saveReplyComment(dto);
    }

    /**
     * 查询评论列表
     */
    @PostMapping("/load")
    public ResponseResult loadComment(@RequestBody CommentReplySearchDto dto) {
        return commentReplyService.loadReplyComment(dto);
    }

    /**
     * 点赞评论
     */
    @PostMapping("/like")
    public ResponseResult likeComment(@RequestBody CommentReplyLikeDto dto) {
        return commentReplyService.likeReplyComment(dto);
    }
}
